package com.servlet.service.impl;

import com.servlet.bean.User;
import com.servlet.dao.UserDao;
import com.servlet.service.UserService;

import java.sql.SQLException;

/**
 * @Title: UserServiceImpl
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2023/12/25 15:13
 */
public class UserServiceImpl implements UserService {
    private UserDao userDao = new UserDao();
    @Override
    public void registerUser(User user) throws SQLException {
        userDao.addUser(user);
    }

    @Override
    public User loginUser(String username) throws SQLException{
        return userDao.queryUserByUsername(username);
    }
}
